package com.dog.framework.core.constant;

/**
 * 权限相关通用常量
 *
 * @author liuxk
 */
public class SecurityConstants {

    public final static String REDIS_KEY_PREFIX="dog_cloud:";

    public static final String TOKEN_JWT_KEY = "0123456789_0123456789_0123456789";

    public final static String METHOD_SUFFIX=":";

    /**
     * 令牌自定义标识
     */
    public static final String TOKEN_AUTHENTICATION = "Authorization";

    /**
     * 令牌前缀
     */
    public static final String TOKEN_PREFIX = "Bearer ";

    public static final String JWT_USER = "jwt_user";

    public static final String JWT_USER_ID = "user_id";

    public static final String JWT_USERNAME = "username";

    public static final String JWT_PASSWORD = "password";

    public static final String JWT_USER_ROLE = "user_role";

    public static final String JWT_DATA_SCOPE = "data_scope";

    public static final String JWT_ORG_ID = "org_id";

    public static final String JWT_TENANT_ID = "tenant_Id";

    public static final String JWT_JTI = "jti";

    public static final String JWT_EXPR = "expr";

    public static final String JWT_AUTHORITIES_NAME = "authorities";

    /**
     * JWT令牌黑名单的KEY
     */
    public final static String JWT_JTI_KEY_PREFIX = SecurityConstants.REDIS_KEY_PREFIX+"jwt:black:";


    /**
     * 权限<->url对应的KEY
     */
    public final static String RESOURCE_ROLES_MAP_KEY= SecurityConstants.REDIS_KEY_PREFIX+"jwt:resource_roles:";



    /**
     * 请求来源
     */
    public static final String FROM = "from";

    /**
     * 内部请求
     */
    public static final String FROM_IN = "inner";

    /**
     * 用户标识
     */
    public static final String USER_KEY = "user_key";


}
